package com.scau.os.extension;

import java.io.File;
import java.io.InputStream;

import com.scau.os.DesktopLauncher;
import com.scau.os.Launcher;
import com.scau.os.controller.DesktopController;

import javafx.scene.control.Alert;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class Utility {
    public static Image getFxImage(String path){
        InputStream stream = Launcher.class.getResourceAsStream(path);
        Image bg = new Image(stream);
        return bg;
    }

    public static void showAlert(String title,String headerText,String contentText){
        Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.setGraphic(new ImageView(Utility.getFxImage("Image/Warning.png")));
        alert.setTitle(title);
        alert.setHeaderText(headerText);
        alert.setContentText(contentText);
        alert.show();
    }
}
